package com.cat.greedyAlgorithm;

import java.util.Arrays;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/maximum-number-of-groups-entering-a-competition/
 * @create 2025/10/10 11:46
 * @since JDK17
 */

public class Solution70 {
    public int maximumGroups(int[] grades) {
        int n = grades.length, ans = 0, num = 1;
        while (n >= num) {
            n -= num++;
            ans++;
        }

        return ans;
    }
}
